import 'package:tender_flutter/page/home/model/user_info_entity.dart';

userInfoEntityFromJson(UserInfoEntity data, Map<String, dynamic> json) {
	if (json['token'] != null) {
		data.token = json['token'].toString();
	}
	if (json['area'] != null) {
		data.area = json['area'].toString();
	}
	if (json['area_id'] != null) {
		data.areaId = json['area_id'].toString();
	}
	if (json['phone'] != null) {
		data.phone = json['phone'].toString();
	}
	if (json['level'] != null) {
		data.level = json['level'] is String
				? int.tryParse(json['level'])
				: json['level'].toInt();
	}
	if (json['num'] != null) {
		data.num = json['num'] is String
				? int.tryParse(json['num'])
				: json['num'].toInt();
	}
	if (json['sex'] != null) {
		data.sex = json['sex'].toString();
	}
	if (json['nickname'] != null) {
		data.nickname = json['nickname'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'] is String
				? int.tryParse(json['id'])
				: json['id'].toInt();
	}
	if (json['picture'] != null) {
		data.picture = json['picture'].toString();
	}
	if (json['email'] != null) {
		data.email = json['email'].toString();
	}
	if (json['username'] != null) {
		data.username = json['username'].toString();
	}
	if (json['company'] != null) {
		data.company = json['company'].toString();
	}
	if (json['txBeginMoney'] != null) {
		data.txBeginMoney = json['txBeginMoney'].toString();
	}
	if (json['inMoney'] != null) {
		data.inMoney = json['inMoney'].toString();
	}
	if (json['money'] != null) {
		data.money = json['money'] is String
				? double.tryParse(json['money'])
				: json['money'].toDouble();
	}
	if (json['code'] != null) {
		data.code = json['code'].toString();
	}
	if (json['expireDate'] != null) {
		data.expireDate = json['expireDate'].toString();
	}
	if (json['inviteCode'] != null) {
		data.inviteCode = json['inviteCode'].toString();
	}
	if (json['msgUnreadNum'] != null) {
		data.msgUnreadNum = json['msgUnreadNum'] is String
				? int.tryParse(json['msgUnreadNum'])
				: json['msgUnreadNum'].toInt();
	}
	if (json['JKTimes'] != null) {
		data.jkTime = json['JKTimes'].toString();
	}
	if (json['TYTimes'] != null) {
		data.tyTime = json['TYTimes'].toString();
	}
	if (json['vipValid'] != null) {
		data.vipValid = json['vipValid'];
	}
	if (json['isInvited'] != null) {
		data.isInvited = json['isInvited'];
	}
	return data;
}

Map<String, dynamic> userInfoEntityToJson(UserInfoEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['token'] = entity.token;
	data['area'] = entity.area;
	data['area_id'] = entity.areaId;
	data['phone'] = entity.phone;
	data['level'] = entity.level;
	data['num'] = entity.num;
	data['sex'] = entity.sex;
	data['nickname'] = entity.nickname;
	data['id'] = entity.id;
	data['picture'] = entity.picture;
	data['email'] = entity.email;
	data['username'] = entity.username;
	data['company'] = entity.company;
	data['txBeginMoney'] = entity.txBeginMoney;
	data['inMoney'] = entity.inMoney;
	data['money'] = entity.money;
	data['code'] = entity.code;
	data['expireDate'] = entity.expireDate;
	data['inviteCode'] = entity.inviteCode;
	data['msgUnreadNum'] = entity.msgUnreadNum;
	data['JKTimes'] = entity.jkTime;
	data['TYTimes'] = entity.tyTime;
	data['vipValid'] = entity.vipValid;
	data['isInvited'] = entity.isInvited;
	return data;
}